# Maintainer: Jiachen YANG <farseerfc@gmail.com>
# AUR Maintainer: Gabriel Rauter <rauter.gabriel@gmail.com>

arch=('loong64' 'x86_64')
_pkgname=KDiskMark
_singleapplication_commit=f1e1508
pkgname=kdiskmark
pkgver=3.1.4
pkgrel=1
pkgdesc="HDD and SSD benchmark tool with a very friendly graphical user interface"
url="https://github.com/JonMagon/${_pkgname}"
license=(GPL3)
depends=(qt5-base fio libaio hicolor-icon-theme kauth5 glibc gcc-libs polkit-qt5)
makedepends=(git cmake extra-cmake-modules qt5-tools)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/JonMagon/${_pkgname}/archive/${pkgver}.tar.gz"
        "git+https://github.com/itay-grudev/SingleApplication.git#commit=${_singleapplication_commit}")
sha256sums=('f66ddefe2c7c2eaf07869d75c437df14565dd06bcb914d89aead002f3b9c1da5'
            'SKIP')


prepare() {
    cd "${_pkgname}-${pkgver}"
    rmdir "src/singleapplication"
    mv "$srcdir/SingleApplication" "src/singleapplication"
}

build() {
    cmake -B build -S "${_pkgname}-${pkgver}" \
        -DCMAKE_INSTALL_PREFIX='/usr' \
        -DCMAKE_INSTALL_LIBEXECDIR='lib' \
        -Wno-dev
    make -C build
}

package() {
  DESTDIR="$pkgdir" make -C build install
}
